<?php
/**
 * View AJAX - Anteprima Video Youtube/Vimeo  LaFabbrica.org
 * 
 * @author     luigi.pastore (gigi@la-fabbrica.org)
 * @created    22-nov-2011
 * @package    LaFabbrica
 * @copyright  Copyright (c) 2011 Luigi Pastore
 */
?>
<script type="text/javascript">
    //<![CDATA[
     
    $(document).ready(function()
    {
        $("#link_preview_box_<?php echo $this->id?>").hide();
        $("#post_link<?php echo $this->id?>").rules("add", {
            url: true,
            messages: {
                url: "asd<?php echo sprintf( ERR_URL, 'Url' ) ?>"
            }
        });

    });

    //]]>
</script>
<ul class="video-preview-box">
    <li class="<?php echo $this->errorMsg['post_link'] ? 'error' : '' ?> with-preview">
        <label class="desc <?php echo $this->errorMsg['post_link1'] ? 'error' : '' ?>">Link <?php echo $this->id?></label>
            <div>
                <span class="input">
                    <input class="field text addr link-url" name="post_links[]" id="post_link<?php echo $this->id?>" size="50" type="text" value="<?php echo $this->data['post_link']?>" />
                    <label>Descrizione</label>
                </span>

                <span class="input">
                    <input class="field text addr link-desc" name="post_link_desc[]" id="post_link_desc<?php echo $this->id?>" size="50" type="text" value="<?php echo $this->data['post_link_desc']?>" />
                </span>
            </div>
        <p class="error" style="<?php echo $this->errorMsg['post_link'] ? 'display:block' : '' ?>"><?php echo $this->errorMsg['post_link'] ?></p>
    </li>

    <li class="preview-box" id="link_preview_box_<?php echo $this->id?>">
        <span>
        <small><strong>Anteprima</strong></small>
        </span>
        <div id="link_preview_<?php echo $this->id?>" class="link-preview"></div>
    </li>
    <li class="with-preview remove">
        <span class="actions">
            <a class="del" id="post-link-<?php echo $this->id?>">Elimina</a>
        </span>
    </li>                
</ul>